import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

@Schema({ timestamps: { createdAt: 'createTime', updatedAt: 'updateTime' } })
export class LogisticsQuery {
  @Prop({ required: false, type: Object })
  logisticsConfig: { id: string; name: string }; //物流配置id
  @Prop({ required: false, type: Array })
  area: string[]; //地点数组

  @Prop({ required: false, type: Array })
  weightPrice: number[]; // 价格数组

  @Prop({ type: Number, default: 0, required: false })
  lowCharge: number; // 最低收费
}

export type OpenApiDocument = LogisticsQuery & Document;

export const OpenApiSchema = SchemaFactory.createForClass(LogisticsQuery);
